import string
text = input()
offset = int(input())
before = string. ascii_lowercase
after = before[offset:] + before[: offset]
table =' '. maketrans(before, after)
code_text = text. translate(table)
print(code_text)